<template>
  <div id="landlist"> 


          <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">

               
                <el-table-column label="兑换时间"  align='center' width="180">                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.time }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="兑换账号"  align='center' width="180">                   
                    <template slot-scope="scope">                   
                        <span style="display: flex;align-items: center;justify-content: center;">
                                 {{ scope.row.telphone }}
                                <img src="@/assets/images/a9.png" style="width:18px;height:20px;margin-left:5px;" @click="goinforpersonal(scope.row,scope.row.telphone)"/>
                            </span>  
                    </template>
                </el-table-column>
                <el-table-column label="账号昵称"  align='center' width="150">                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.nickname }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="扭蛋类别"  align='center' >                   
                    <template slot-scope="scope">                   
                         <div>
                            <span v-if="scope.row.type == 'CASH'">金蛋<span  class="see_span" @click="show_but(scope.row)"><i class="el-icon-view el-icon--right"></i></span></span>  
                            <span v-if="scope.row.type == 'RANGE_CASH'">彩蛋</span> 
                            <span v-if="scope.row.type == 'GDB' || scope.row.type == 'KMB'">银蛋</span> 
                          </div>
                    </template>
                </el-table-column>
                <el-table-column label="兑换方式"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >
                            <span v-if="scope.row.type == 'CASH'">现金</span>
                            <span v-if="scope.row.type == 'RANGE_CASH'">现金</span>
                            <span v-if="scope.row.type == 'GDB' ">金蜜</span>
                            <span v-if="scope.row.type == 'KMB' ">蜜贝</span>
                        </span>
                    </template>
                </el-table-column>
                <el-table-column label="兑换价值"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.price }}</span>
                    </template>
                </el-table-column>
                
                 <el-table-column label="银行账户名称"  align='center' width="200" >                   
                    <template slot-scope="scope">                   
                        <span >
                           <span v-if="scope.row.bank != null">{{ scope.row.bank.username }}</span>
                        </span>
                    </template>
                </el-table-column>
                <el-table-column label="开户银行"  align='center' width="200">                   
                    <template slot-scope="scope">   
                      <span >
                           <span v-if="scope.row.bank != null">{{ scope.row.bank.bankopen }}</span>
                      </span>                
                    </template>
                </el-table-column>
                 <el-table-column label="具体支行"  align='center' width="200">                   
                    <template slot-scope="scope">                   
                         <span >
                           <span v-if="scope.row.bank != null">{{ scope.row.bank.bankname }}</span>
                      </span>  
                    </template>
                </el-table-column>
                 <el-table-column label="开户账号"  align='center' width="200" >                   
                    <template slot-scope="scope">         
                       <span >
                           <span v-if="scope.row.bank != null">{{ scope.row.bank.bankcard }}</span>
                      </span>            
                    </template>
                </el-table-column>
                 <el-table-column label="账户信息"  align='center' >                   
                    <template slot-scope="scope">                   
                         <span v-if="scope.row.type == 'CASH' || scope.row.type == 'RANGE_CASH' ">
                              <el-image v-if="scope.row.srcListyhk"
                                style="width: 30px; height: 30px"
                                :src="urlimg + scope.row.srcListyhk" 
                                :preview-src-list="scope.row.srcList5" class="imga">
                             </el-image>
                             <span v-else>暂未上传</span>
                        </span>
                        <span v-else>--</span>
                    </template>
                </el-table-column>

                 <el-table-column label="操作" align='center' fixed="right" width="180">
                    <template slot-scope="scope">
                      <span v-if="scope.row.type != 'GDB'">
                          <span v-if="scope.row.type != 'KMB'">
                               <span v-if="scope.row.cash_send == 0 && scope.row.reject == 0">
                                    <el-button size="mini"  type="primary"  plain class="button_class1" @click="ff_but(scope.row)">发放</el-button>
                                    <el-button size="mini"  type="primary"  plain class="button_class2" @click="bh_but(scope.row)">驳回</el-button>
                               </span> 
                               <span v-if="scope.row.cash_send == 1 ">
                                    <el-button size="mini"  type="primary"  plain class="button_class1">已发放</el-button>
                               </span> 
                               <span v-if="scope.row.reject == 1 ">
                                    <el-button size="mini"  type="primary"  plain class="button_class2">已驳回</el-button>
                               </span>                                                          
                          </span>
                      </span>
                    </template>
                </el-table-column>
              
            </el-table>  


       <el-dialog title='金蛋明细' :visible.sync="mtk1"  width="600px">
          <div style="width:100%;"> 
                <el-table :data="mtk1_form.datalist" style="width: 100%" height="500px" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">
                 
                  <el-table-column label="标的类别"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.manor_title }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="标的编号"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.pid }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="标的价值"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.price }}</span>
                    </template>
                </el-table-column>
            </el-table> 
          </div> 
      </el-dialog>


   </div>
</template>

<script>

export default {
   name: 'landlist',
   props:{
      datalist:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度'
        mtk1:false,
        mtk1_form:{
          datalist:[]
        },
        my_id:''
        
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 410
      
  },
  mounted (){
    
  },
  methods: {
    ff_but(row){
         this.$confirm('是否发放奖励, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
         }).then(() => {
            this.post("/draw_lottery/cashSend", {
                    id:row.id,
                }).then(res => {
                    if(res.error_code == 0){
                    this.open1(res.result,'success')  //提示框
                    this.$emit('up_list_fun')
                    }else {
                    this.open1(res.message,'warning')
                }

             })
        }).catch(() => {
              
        });
    },
    bh_but(row){
        this.$confirm('是否驳回奖励, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
         }).then(() => {
            this.post("/draw_lottery/reject", {
                    id:row.id,
                }).then(res => {
                    if(res.error_code == 0){
                    this.open1(res.result,'success')  //提示框
                    this.$emit('up_list_fun')
                    }else {
                    this.open1(res.message,'warning')
                }

             })
        }).catch(() => {
              
        });
    },
    show_but(row){
        this.my_id = row.id
        this.show_run()
        this.mtk1 = true
    },
    show_run(){
      this.post("/draw_lottery/goldEggDetail", {
              id:this.my_id,
	        }).then(res => {
            this.mtk1_form.datalist = res.result
            console.log(res.result,"aaa")
         })
    },
    goinforpersonal(row,telphone){      
        this.$router.push({
          path: '/index/inforpersonal',
          query: {
            name:telphone,
          }
        })
    },

  }
}
</script>


<style scoped>
.item_a{
  display:flex;
  padding:0px 15px;
}
.item_b{
  /* flex: 1; */
  float: left;
  width: calc(100%/2);
  margin-top:30px;
}
.item_b_1{
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: #5E6C84;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item_b_1_img{
  width:20px;
  height: 20px;
  margin-right:5px;
}
.item_b_2{
  /* margin-top: 10px; */
  text-align: center;
  font-size: 30px;
  font-weight: 500;
  color: #344563;
}
.imga>>>.el-icon-circle-close {
      color: white;
}
</style>